home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / indexing / protocols.h < prev   
Text File  |  1994-04-13  |  3KB  |  115 lines

  1. /*
  2. protocols.h
  3. Copyright 1991,NeXT Computer,Inc.
  4. */
  5.  
  6. #import    <objc/Object.h>
  7. #import    <btree/protocols.h>
  8.  
  9. @class NXData, IXAttributeBinder;
  10.  
  11. @protocol IXRecordReading
  12.  
  13. - (unsigned)count;
  14. - readRecord:(unsigned)record fromZone:(NXZone *)zone;
  15. - readRecord:(unsigned)record; // default malloc zone
  16.  
  17. @end
  18.  
  19. @protocol IXRecordWriting <IXRecordReading>
  20.  
  21. - empty;
  22.  
  23. - (unsigned)addRecord:anObject;
  24. - replaceRecord:(unsigned)record with:anObject;
  25. - removeRecord:(unsigned)record;
  26.  
  27. @end
  28.  
  29. // This protocol controls the activation and passivation of objects.  By 
  30. // default, all objects respond to source:didReadRecord: with nil, through a 
  31. // category of Object.  This causes passivation with typed stream archiving.  
  32. // For a much faster passivation mechanism, this method may return an object 
  33. // to be passivated; if self is returned, the receiver is passivated quickly.
  34.  
  35. @protocol IXRecordTranscription
  36.  
  37. - finishReading;
  38. - source:aSource willWriteRecord:(unsigned)record;
  39. - source:aSource didReadRecord:(unsigned)record;
  40.  
  41. @end
  42.  
  43. @protocol IXAttributeBinding
  44.  
  45. // Returns the receiver's attribute binder, if it maintains one.
  46. - (IXAttributeBinder *)attributeBinder;
  47.  
  48. // Returns the receiver's bindings.  The sender owns the object returned.
  49. - (IXAttributeBinder *)provideBindings;
  50.  
  51. @end
  52.  
  53. // These methods evaluate the named instance variable for the specified record. 
  54. // NO is returned if the named instance variable does not exist.
  55.  
  56. @protocol IXTransientAccess
  57.  
  58. - (BOOL)getOpaqueValue:(NXData **)value 
  59.     ofIvar:(const char *)name forRecord:(unsigned)record;
  60. - (BOOL)getIntValue:(int *)value 
  61.     ofIvar:(const char *)name forRecord:(unsigned)record;
  62. - (BOOL)getFloatValue:(float *)value 
  63.     ofIvar:(const char *)name forRecord:(unsigned)record;
  64. - (BOOL)getDoubleValue:(double *)value 
  65.     ofIvar:(const char *)name forRecord:(unsigned)record;
  66. - (BOOL)getStringValue:(char **)value 
  67.     ofIvar:(const char *)name forRecord:(unsigned)record;
  68. - (BOOL)getStringValue:(char **)value inLength:(unsigned)length 
  69.     ofIvar:(const char *)name forRecord:(unsigned)record;
  70. - (BOOL)getObjectValue:(Object **)value 
  71.     ofIvar:(const char *)name forRecord:(unsigned)record;
  72.  
  73. @end
  74.  
  75. // These methods evaluate the supplied selector for the specified record. 
  76. // NO is returned if the object does not respond to the supplied selector.
  77.  
  78. @protocol IXTransientMessaging
  79.  
  80. - (BOOL)getIntValue:(int *)value 
  81.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  82. - (BOOL)getFloatValue:(float *)value
  83.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  84. - (BOOL)getDoubleValue:(double *)value 
  85.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  86. - (BOOL)getStringValue:(char **)value 
  87.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  88. - (BOOL)getStringValue:(char **)value inLength:(unsigned)length 
  89.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  90. - (BOOL)getObjectValue:(Object **)value 
  91.     ofMessage:(SEL)selector forRecord:(unsigned)record;
  92.  
  93. @end
  94.  
  95. // The following protocols are obselete, and may be not be defined in future 
  96. // releases.  The methods are now declared by the classes that implement them.
  97.  
  98. @protocol IXRecordDiscarding
  99.  
  100. - clean;
  101. - discardRecord:(unsigned)record;
  102. - reclaimRecord:(unsigned)record;
  103.  
  104. @end
  105.  
  106. @protocol IXBlobWriting
  107.  
  108. - (BOOL)getValue:(void **)value andLength:(unsigned *)length 
  109.     ofBlob:(const char *)name forRecord:(unsigned)record;
  110. - (BOOL)setValue:(const void *)value andLength:(unsigned)length 
  111.     ofBlob:(const char *)name forRecord:(unsigned)record;
  112.  
  113. @end
  114.  
  115.